<?php

use yii\helpers\Html;
use yii\grid\GridView;
use common\constant\UserConstant;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\searches\AdminSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '管理员';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="admin-index x_panel">

    <div class="x_title">
        <h1><?= Html::encode($this->title) ?></h1>
    </div>

    <div class="x_content">
        <p>
            <?= Html::a('添加', ['create'], ['class' => 'btn btn-success']) ?>
        </p>

        <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
//            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'username',
//            'auth_key',
//            'password_hash',
//            'password_reset_token',
            //'email:email',
            ['attribute'=>'status', 'format'=>'userStatus', 'filter'=>UserConstant::$statusConf],
            'created_at:datetime',
            //'updated_at',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>

    </div>
</div>
